package com.zbkj.admin.model.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.core.handler.GsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author HZW
 * @since 2022-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("eb_user")
@Schema(description = "User对象 用户表")
public class User implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "用户账号")
    private String account;

    @Schema(description = "用户密码")
    private String pwd;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "生日")
    private String birthday;

    @Schema(description = "身份证号码")
    private String identityCardNo;

    @Schema(description = "标签id,英文逗号分隔")
    private String tagId;

    @Schema(description = "用户昵称")
    private String nickname;

    @Schema(description = "用户头像")
    private String avatar;

    @Schema(description = "手机号码")
    private String phone;

    @Schema(description = "国家，中国CN，其他OTHER")
    private String country;

    @Schema(description = "省份")
    private String province;

    @Schema(description = "城市")
    private String city;

    @Schema(description = "区")
    private String district;

    @Schema(description = "详细地址")
    private String address;

    @Schema(description = "性别，0未知，1男，2女，3保密")
    private Integer sex;

    @Schema(description = "用户积分")
    private Integer integral;

    @Schema(description = "用户经验")
    private Integer experience;

    @Schema(description = "用户余额")
    private BigDecimal nowMoney;

    @Schema(description = "佣金金额")
    private BigDecimal brokeragePrice;

    @Schema(description = "等级")
    private Integer level;

    @Schema(description = "连续签到天数")
    private Integer signNum;

    @Schema(description = "是否关联公众号")
    private Boolean isWechatPublic;

    @Schema(description = "是否关联小程序")
    private Boolean isWechatRoutine;

    @Schema(description = "是否关联微信ios")
    private Boolean isWechatIos;

    @Schema(description = "是否关联微信android")
    private Boolean isWechatAndroid;

    @Schema(description = "是否关联ios")
    private Boolean isBindingIos;

    @Schema(description = "用户购买次数")
    private Integer payCount;

    @Schema(description = "是否为推广员")
    private Boolean isPromoter;

    @Schema(description = "成为分销员时间")
    private Date promoterTime;

    @Schema(description = "上级推广员id")
    private Integer spreadUid;

    @Schema(description = "绑定上级推广员时间")
    private Date spreadTime;

    @Schema(description = "下级人数")
    private Integer spreadCount;

    @Schema(description = "注册类型：wechat-公众号，routine-小程序，H5-H5,iosWx-微信ios，androidWx-微信安卓，ios-ios")
    private String registerType;

    @Schema(description = "创建ip")
    private String addIp;

    @Schema(description = "最后一次登录ip")
    private String lastIp;

    @Schema(description = "最后一次登录时间")
    private Date lastLoginTime;

    @Schema(description = "1为正常，0为禁止")
    private Boolean status;

    @Schema(description = "备注")
    private String mark;

    @Schema(description = "添加时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "是否注销")
    private Boolean isLogoff;

    @Schema(description = "注销时间")
    private Date logoffTime;

    @Schema(description = "用户签名")
    private String signature;

    @Schema(description = "是否付费会员")
    private Boolean isPaidMember;

    @Schema(description = "是否永久付费会员")
    private Boolean isPermanentPaidMember;

    @Schema(description = "付费会员到期时间")
    private Date paidMemberExpirationTime;

    @Schema(description = "验证码")
    @TableField(exist = false)
    private String code;

    @Schema(description = "身份证")
    private String identity;

    @Schema(description = "身份证名字")
    private String identityName;

    @Schema(description = "身份证有效期开始")
    private LocalDateTime identityVld;

    @Schema(description = "身份证有效期结束")
    private LocalDateTime identityVldEnd;

    @Schema(description = "身份证图片")
//    @TableField(exist = false)
    private String identityUrl;

    @Schema(description = "身份证图片")
    @TableField(exist = false)
    private String identityUrl1;

    /**
     * 抵用券
     */
    @Schema(description = "抵用券")
    private BigDecimal voucher;

    /**
     * 银行卡
     */
    @Schema(description = "银行卡")
    @TableField(value = "ic_id", typeHandler = FastjsonTypeHandler.class)
    private List<String> icId;
}
